<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>免签人员</title>
    <link rel="stylesheet" type="text/css" href="../lib/laydate.css"/>
    <link rel="stylesheet" type="text/css" href="../lib/pagination/style/pagination.css"/>
    <link rel="stylesheet" type="text/css" href="../css/base.css"/>
    <script type="text/javascript" src="../js/common/language.js" ></script>
    <script type="text/javascript" src="../js/news/jquery-1.9.1.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/news/page.js"></script>
    <script src="../lib/laydate/laydate.js"></script>
    <script src="../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="/js/ajaxupload.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <script src="../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../lib/layer/layer.js?20201106"></script>
    <style>
        .buttonDiv>div{
            float: left;
            margin: 20px 10px;
        }
        .fileDone select{
            width: 160px;
            height:28px;
        }
        #tr_td tr:nth-child(odd){
            background-color: #fff;
        }
        input{
            float: none;
        }
        .newMange input[type="text"]{
            width: 260px;
            height: 30px;
        }
        select{
            width: 260px;
            height: 30px;
        }
        textarea{
            width: 420px;
            min-width: 220px;
            max-width: 420px;
            height: 150px;
            min-height: 80px;
            max-height: 150px;
            /*vertical-align: middle;*/
        }
        a{
            text-decoration: none;
            color: #207bd6;
        }
        .newTbale tr td{
            border-right: #ccc 1px solid;
            padding: 5px;
        }
        .main{
            width: 500px;
            height: 150px;
            /*border: #ccc 1px solid;*/
            margin: 0px auto;
            margin-top: 40px;
            margin-bottom: 20px;
        }
        .saveBtn{
            width: 40px;
            height: 28px;
            background: #2b7fe0;
            border-radius: 4px;
            cursor: pointer;
            text-align: center;
            color: #ffffff;
            line-height: 28px;
            margin: 20px auto;
        }
        .wrap{
            width: 600px;
            margin: 100px auto;
            height: 260px;
            border: #ccc 1px solid;
            background: #fdfdfd;
        }
        .return{
            width: 40px;
            height: 28px;
            background: #2b7fe0;
            border-radius: 4px;
            cursor: pointer;
            text-align: center;
            color: #ffffff;
            line-height: 28px;
            margin: -49px 340px;
        }
        .return a{
            color: #ffffff;

        }
    </style>
</head>

<body>
<div class="bx">

    <div class="navigation  clearfix juMange" id="noPer" style="display: block;">
        <div class="left" style="margin-left: 30px">
            <img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_manageFile.png">
            <div class="news">免签人员</div>
        </div>
        <div class="wrap" style="">
            <div class="main">
                <textarea name="paraValue" id="paraValue" user_id='' readonly></textarea>
                <a href="javascript:;" class="addUser" style="margin: 0 10px;">添加</a>
                <a href="javascript:;" class="clearUser">清除</a>
            </div>
            <div class="saveBtn">保存</div>
            <div class="return"><a href="/attendanceWay/attindex">返回</a></div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var user_id='';
    $(function () {

        init($('#paraValue'));

        $('.addUser').click(function () {
            user_id='paraValue';
            $.popWindow("../common/selectUser");
        })
        $('.clearUser').click(function () {
            $('#paraValue').attr('user_id','');
            $('#paraValue').attr('username','');
            $('#paraValue').attr('dataid','');
            $('#paraValue').attr('userprivname','');
            $('#paraValue').val('');
        })
        $('.saveBtn').click(function () {
            var dataName=$('#paraValue').attr('user_id');
            $.ajax({
                type:'post',
                url:'/syspara/setSysPara',
                dataType:'json',
                data:{
                    paraName:'NO_DUTY_USER',
                    paraValue:dataName
                },
                success:function (res) {
                    if(res.flag){
                        $.layerMsg({content:'新建成功！',icon:1})
                        init($('#paraValue'));
                    }else{
                        $.layerMsg({content:'新建失败！',icon:2})
                    }
                }
            })
        })
    })
    function init(element) {
        $.ajax({
            type:'get',
            url:'/syspara/getOperator',
            dataType:'json',
            data:{paraName:'NO_DUTY_USER'},
            success:function (res) {
                var data=res.object
                element.attr('user_id',data.paraValue+',');
                element.val(data.userName+',');
            }
        })
    }
</script>
</body>
</html>
